package com.book.xsp.bookparent.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.book.xsp.bookparent.entity.Student;
import com.book.xsp.bookparent.mapper.StudentMapper;
import com.book.xsp.bookparent.service.IStudentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author snake_skin
 * @since 2023-11-29
 */
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements IStudentService {

    @Override
    public List<Student> getALlStudent() {
        List<Student> studentList = baseMapper.selectList(null);
        return studentList;
    }

    @Override
    public Student getStudentByNo(String studentNo) {
        QueryWrapper<Student> qw = new QueryWrapper<>();
        qw.eq("student_no",studentNo);
        Student student = baseMapper.selectOne(qw);
        return student;
    }
}
